<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Insert title here</title>
	<link type="text/css" rel="stylesheet"
		  href="//misc.360buyimg.com/??jdf/1.0.0/unit/ui-base/5.0.0/ui-base.css,jdf/1.0.0/unit/shortcut/5.0.0/shortcut.css,jdf/1.0.0/unit/global-header/1.0.0/global-header.css,jdf/1.0.0/unit/myjd/5.0.0/myjd.css,jdf/1.0.0/unit/nav/2.0.0/nav.css,jdf/1.0.0/unit/shoppingcart/2.0.0/shoppingcart.css,jdf/1.0.0/unit/global-footer/5.0.0/global-footer.css,jdf/1.0.0/unit/service/5.0.0/service.css,user/myjd/lib/1.0.0/widget/global/global.css">

	<link type="text/css" rel="stylesheet"
		  href="//misc.360buyimg.com/user/myjd/ordercenter/??css/myjd.order.css,widget/top-search/top-search.css,widget/order-table-list/order-table-list.css,widget/ui-page/ui-page.css,widget/order-goods-list/order-goods-list.css,widget/ui-slidebar/ui-slidebar.css,widget/common/common.css"
		  source="combo">
	<!-- 	<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">  -->
</head>
<body>
<div id="container">
	<div class="w">
		<div id="content">
			<div id="main">
				<div id="chunjie" class="mb10"></div>
				<div class="mod-main mod-comm mod-order" id="order01">
					<div class="mt">
						<h3>我的订单</h3>
						<div class="extra-r"></div>
					</div>
				</div>
				<div class="safety-box hide"></div>

				<div class="mod-main mod-comm lefta-box" id="order02">
					<div class="mt">
						<ul class="extra-l">
							<li class="fore1"><a class="txt curr">全部订单</a></li>
						</ul>
					</div>
					<div class="mc">
						<table class="td-void order-tb" id="DataTables_list">

							<thead>

							<tr>
								<th >订单号</th>
								<th >下单时间</th>
								<th >影院名</th>
								<th >电影名</th>
								<th >电影时长</th>
								<th >开场时间</th>
								<th >播放厅名</th>
								<th >座位</th>
								<th >总价</th>
								<th >影院地址</th>
								<th>
									<div class="deal-state-cont" id="orderState">
										<div class="state-txt">状态</div>

									</div>
								</th>
							</tr>
							</thead>
							<tbody id="tb-113810613169">

							<%--<tr>--%>
							<%--<td class="hidden-xs">1</td>--%>
							<%--<td class="hidden-xs">张无忌</td>--%>
							<%--<td class="hidden-xs">1989-10-14</td>--%>
							<%--<td class="hidden-xs">西虹市首富</td>--%>
							<%--<td class="hidden-xs">万达影院</td>--%>
							<%--<td class="hidden-xs">一号厅</td>--%>
							<%--<td class="hidden-xs">6-6,6-7</td>--%>
							<%--<td class="hidden-xs">188</td>--%>
							<%--<td></td>--%>
							<%--<td class="hidden-xs" width="100">188</td>--%>
							<%--<td width="50"></td>--%>
							<%--</tr>--%>

							</tbody>
						</table>

						<div class="mt20">
							<!-- <div class="pagin fr">
                                <span class="prev-disabled">上一页<b></b></span> <a
                                    class="current">1</a> <span class="next-disabled">下一页<b></b></span>
                            </div>
                            <div class="clr"></div> -->
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="../../front/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="js/jquery.min.js" ></script>
<script type="text/javascript">
	$(function() {
		var accountId = "${sessionScope.account.accountId}";
		$.ajax({
			async:true,
			url:"${pageContext.request.contextPath}/order/getOrderInfo",
			type:"GET",
			contentType:"application/json",
			data:{
				accountId: accountId
			},
			dataType:"json",
			success:function(result){// result是一个map
				//拼接查询到的信息
				var content = "";
				for (var i = 0; i < result.length; i++) {
					var state = result[i].isDelete==0?"退票申请":(result[i].isDelete==1?"完成":"退票成功");
					var startTime = new Date(result[i].startTime);
					var startDay = startTime.getDate()-1;
					var startMinutes = startTime.getMinutes();
					var startHours = startTime.getHours();
					var startDate = startDay+"号"+startHours+"点"+startMinutes+"分";
					var orderTime = new Date(result[i].orderTime);
					var orderDay = orderTime.getDate()-1;
					var orderMinutes = orderTime.getMinutes();
					var orderHours = orderTime.getHours();
					var orderDate = orderDay+"号"+orderHours+"点"+orderMinutes+"分";
					// var ot = result[i].orderTime;
					// var st = result[i].startTime
					// SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
					// var ot1=f.format(ot);
					// var st1=f.format(st);
					content+="<tr>\n" +
							"<td>"+result[i].orderId+"</td>\n" +
							"<td>"+orderDate+"</td>\n" +
							"<td>"+result[i].cinemaName+"</td>\n" +
							"<td>"+result[i].movieName+"</td>\n" +
							"<td>"+result[i].playTime+"</td>\n" +
							"<td>"+startDate+"</td>\n" +
							"<td>"+result[i].hallName+"</td>\n" +
							"<td>"+result[i].xAxis+"-"+result[i].yAxia+"</td>\n" +
							"<td>"+result[i].price+"</td>\n" +
							"<td class=\"hidden-xs\" width=\"100\">"+result[i].address+"</td>\n" +
							"<td width=\"50\">"+state+"</td>\n"+
							"</tr>";
				}
				$("#DataTables_list tbody").append(content);
			},
			//请求失败时的响应函数
			error:function(){
				console.log("请求失败");
			}
		});
	})
</script>
</body>
</html>